﻿using System.Globalization;
using System.Net.Http;
using CkSoftware.GroupMe.Sdk.Core;
using CkSoftware.GroupMe.Sdk.Core.Dao;
using CkSoftware.GroupMe.Sdk.Groups.Dao;

namespace CkSoftware.GroupMe.Sdk.Groups.Commands
{
	/// <summary>
	/// Show group command (GroupMe documentation: <see href="https://dev.groupme.com/docs/v3#groups_show" />).
	/// </summary>
	public class ShowGroupCommand : IWebApiCommand<GroupMeApiResponse<GroupData>>
	{
		private readonly string _groupId;

		/// <summary>
		/// Instantiate a new <see cref="ShowGroupCommand" /> using the given groupId.
		/// </summary>
		/// <param name="groupId">The group id to get the details for.</param>
		public ShowGroupCommand(string groupId)
		{
			_groupId = groupId;
		}

		/// <summary>
		/// Defines if the command is executed once.
		/// </summary>
		public bool CommandExecuted { get; set; }

		/// <summary>
		/// The name of the command to be executed.
		/// </summary>
		public string CommandName
		{
			get { return string.Format(CultureInfo.CurrentCulture, "groups/{0}", _groupId); }
		}

		/// <summary>
		/// The http method to execute this command.
		/// </summary>
		public HttpMethod HttpMethod
		{
			get { return HttpMethod.Get; }
		}

		/// <summary>
		/// The parameters which should be used on command execution.
		/// </summary>
		public IWebApiCommandParameters Parameters
		{
			get { return null; }
		}
	}
}